package run;

import interact.MouseHander;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PVector;
import processing.video.*;

public class Doodler extends PApplet {

	  Env e;
	private MouseHander m;
	Capture myCap;
	public static Doodler instance;
	
	  public void setup() {
		instance = this;
	    size(1000, 650, PConstants.P2D);
	    //rectMode(CENTER);
	    noStroke();
	    smooth();
	    background(255);
	    e = new Env(this);
		frameRate(30);
	    m = new MouseHander(this, e);
	    
//	    String[] list = Capture.list();
//	    System.out.println(list[0]);
//	    myCap = new Capture(this, 200, 300, "DV Video", 30);
	  }
//
//	  void captureEvent(Capture myCapture) {
//		  myCapture.read();
//	  }
	  
	  public void keyPressed() {
		  if (key == 's') {
			  Env.GLOBAL_REPULSE_CONST += 0.01;
		  }
		  if (key == 'a') {
			  Env.GLOBAL_REPULSE_CONST -= 0.01;
		  }
		  
		  System.out.println(Env.GLOBAL_REPULSE_CONST);
	  }
	  
	  public void draw() {
		  
		  // initialize a few line cells (the guys who generate the drawing)
		  e.draw();
		  
//		  image(myCap, 0, 0);
		  // how do we do collision detection...?
		  
		  // initialize some environmental stuff (gravitons)
		  
	  }
	  
	  
}
